﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HZ.MBSM.DBUtility;
public partial class System_MasterPageCompany : System.Web.UI.MasterPage
{
    public string AccountName;
    protected void Page_Load(object sender, EventArgs e)
    {
        changeVisible();
    }


    /// <summary>
    /// 0：生产企业；1：经营企业；2：一级代理
    /// </summary>
    public void changeVisible()
    {
        HZ.MBSM.Model.Account _Account = (HZ.MBSM.Model.Account)Session["Account"];
        string sort = _Account.Sort;
        AccountName = _Account.AccountName;
        int _intProductAddStatus = 0;
        Db db = new Db();
        string strSql = "select CompanyName,ProductAddStatus,lastyearPayDuty,companyRegistermeney from company where Accountid='" + _Account.AccountId.ToString() + "'";
        System.Data.IDataReader dr;
        dr = db.DataReader(strSql);
        while (dr.Read())
        {
            _intProductAddStatus = SysFun.ToInt(dr["ProductAddStatus"].ToString());
        }
        dr.Close();
        dr.Dispose();
        db.Close();

        if (sort == "0" || sort == "2" || _intProductAddStatus==1)
        {
            tr1.Visible = true;  
        }
        else
        {
            tr1.Visible = false;  
        }
        if (sort == "1" || sort == "2" )   //参与省级配送企业遴选
        {
             trPSLX.Visible = true;    
        }
        else
        {
            trPSLX.Visible = false;
        }
    }
}
